home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1 / Ian and Stuart's One (Australia).iso / Australasian Legends / Commercial / Rainbow Hill / MacDOS™ 2.0.0 / User's Guide / 09 Customising MacDOS < prev    next >
Text File  |  1994-09-20  |  14KB  |  306 lines

  1. 9  Customising MacDOS
  2.  
  3. autoexec.bat
  4.        MacDOS  launches the batch program named autoexec.bat  every
  5.        time  it starts. Therefore, autoexec.bat is effectively  the
  6.        MacDOS' preference file. In it you can:
  7.          •   Set your preferred date format with DATE.
  8.          •   Set a 12 or 24 hour clock with TIME.
  9.          •     Make   your   life   a  bit  more   dangerous   with
  10.           CONFIRM OFF.
  11.          •   Make file copies faster with VERIFY OFF.
  12.          •    Ensure  that  you do not overlook any error  messages
  13.           by  forcing  MacDOS to display an alert box  whenever  an
  14.           error  or warning condition occurs. For this purpose  use
  15.           the command ALARM ON.
  16.          •    Use  PATH  to tell MacDOS in which folders  you  keep
  17.           your executable files (applications and batch programs).
  18.          •   Set your preferred command prompt with PROMPT.
  19.          •    SET  the  system  variable DIRCMD to  your  preferred
  20.           defaults for listing folders.
  21.          •   Assign your literal volume IDs with SUBSTVOL.
  22.          •    Use  CALL to execute additional initialisation  batch
  23.           programs and to launch other Mac applications.
  24.          •    Use  TYPE to display a text file containing reminders
  25.           of things to do.
  26.          •    Store  the  MacDOS  directory name  into  the  global
  27.           variable HOME by SETting it to %WHERE%.
  28.          •   Attach to your working folder with CHDIR.
  29.          •   ECHO to the screen a welcoming message.
  30.          •    Set  up  your  abbreviations by SETting the  variable
  31.           ABBREV.
  32.          •    Change  the size of the characters displayed  in  the
  33.           console window by SETting the system variable FONTSIZE.
  34.          •    Change  the character used for quoting long filenames
  35.           by SETting the system variable QUOTE.
  36.          •    Change  the file creator used for output  text  files
  37.           by SETting the system variable CREATOR.
  38.          •    Decide  to  be notified of all incoming Apple  Events
  39.           by SETting the variable SHOWAE.
  40.  
  41. Date
  42.        You  can change the system date with the command DATE.  With
  43.        the  same  command  you  can  also  choose  the  format  for
  44.        entering and displaying dates.
  45.  
  46.        For  example, you can choose to use an American  format  for
  47.        the dates by typing:
  48.           date mm/dd/yy
  49.        If you then change the system date with the command
  50.           date 5/23/94
  51.        MacDOS will display the new date as:
  52.           05/23/94
  53.  
  54.        Alternatively, you can compose your own date format:
  55.           date yyyy;mmmm,dddd
  56.        If you then change the system date with the command
  57.           date 94;5,23
  58.        MacDOS will display the new date as:
  59.           1994;0005,0023
  60.  
  61. Time
  62.        When  you change the system time with the command TIME,  you
  63.        can  at  the  same time choose between a 12 and  a  24  hour
  64.        clock  format.  You  can  also choose  the  separators  used
  65.        between the time fields.
  66.  
  67.        For example, if you set the system time with the command
  68.           time 17.20.10
  69.        MacDOS  will display times with a 24 hour clock and dots  as
  70.        separators.
  71.  
  72.        If  you  set  the system time to midnight, MacDOS interprets
  73.        the  command  as a request to change the clock format.  This
  74.        means  that  you cannot actually change the system  time  to
  75.        midnight (you will have to wait at least one second !),  but
  76.        gives  you  the  possibility of choosing  the  clock  format
  77.        without altering the current system time.
  78.  
  79.        Therefore,
  80.           time 00:00:00a
  81.        leaves the current time unchanged and switches to a 12  hour
  82.        clock. Similarly,
  83.           time 24:00:00
  84.        switches  to  a  24 hour clock without touching  the  system
  85.        time.
  86.  
  87. Alerts
  88.        By  default, MacDOS reports errors and warnings with a  line
  89.        of  text.  If  you execute the command  ALARM  ON  ,  MacDOS
  90.        replaces  the line of text with an alert box and  waits  for
  91.        you to click on its OK button before continuing.
  92.  
  93.        ALARM  OFF  reverts the error and warning reporting  to  the
  94.        default.
  95.  
  96.        With  ALARM  ON  ,  you can execute complex  batch  programs
  97.        without  having to monitor their progress, because you  know
  98.        that   MacDOS   automatically  suspends  execution   if   it
  99.        encounters a problem.
  100.  
  101. Confirmation
  102.        When  you use the Finder to move files between folders,  the
  103.        Finder  always  asks  for  confirmation  before  overwriting
  104.        existing  files. Also when you empty the Trash you  have  to
  105.        confirm it.
  106.  
  107.        By  default,  MacDOS  does  the same  and  prompts  you  for
  108.        confirmation.  This is particularly important when  DELeting
  109.        files,  because MacDOS removes them from the system  instead
  110.        of copying them to the Trash.
  111.  
  112.        You  can  direct  MacDOS  not to  ask  for  confirmation  by
  113.        executing  CONFIRM OFF .
  114.  
  115.        You  can  then revert to the safer default with the  command
  116.        CONFIRM ON .
  117.  
  118.        It  is  a  good  and safe practice to disable  confirmations
  119.        only  in  special cases and for short periods  of  time.  Be
  120.        aware of the fact that if you disable confirmation within  a
  121.        batch  program,  it  remains disabled after  the  batch  has
  122.        completed  execution. It is therefore advisable to re-enable
  123.        safeguards within the same batch file that disables them.
  124.  
  125. Verification of File Copying
  126.        By  default, MacDOS verifies the correctness of all COPY and
  127.        XCOPY  operations. You can disable verification by executing
  128.        VERIFY  OFF.  You can then revert back to the safer  default
  129.        with  VERIFY ON .
  130.  
  131.        With   VERIFY  ON  , MacDOS reads the copy and  compares  it
  132.        with  the  original. Naturally, this slows  down  the  whole
  133.        operation. Nevertheless, it is advisable to put up with  the
  134.        little  delay,  especially when copying  to  floppies:  only
  135.        when  the files are read back correctly you can be sure that
  136.        they were written correctly.
  137.  
  138. Prompt
  139.        The  command PROMPT tells MacDOS how to prompt you for a new
  140.        command.  Through PROMPT, you can request MacDOS to  display
  141.        special  information like the current  date  and  time,  the
  142.        specification of the current folder, the current volume  ID,
  143.        and the MacDOS version.
  144.  
  145.        PROMPT  is in fact a command which is totally equivalent  to
  146.        the   SETting  of  the  system  variable  PROMPT.  The  only
  147.        advantage of using the command instead of a straight SET  is
  148.        that  the  command  performs a syntax check  on  the  prompt
  149.        string.
  150.  
  151. Literal Volume IDs
  152.        Instead  of  using  straight  volume  reference  numbers  to
  153.        identify  volumes,  you  can use  the  command  SUBSTVOL  to
  154.        define  literal  IDs.  To a large extent,  this  is  just  a
  155.        cosmetic  change. Nevertheless, it can be of great  help  if
  156.        you  want  to  port batch programs originally developed  for
  157.        DOS.
  158.  
  159. Abbreviations
  160.        MacDOS  supports  an abbreviation mechanism  that  lets  you
  161.        type  short  words to insert long strings into  the  command
  162.        line.
  163.  
  164.        To use this mechanism, you must:
  165.        •  Store your abbreviations into a file.
  166.        •  Tell MacDOS how to find the file.
  167.        •  Tell MacDOS what abbreviation you want to have expanded.
  168.  
  169.      Preparing an Abbreviation File
  170.        With  any  text editor or word processor, create a  file  of
  171.        type 'TEXT' and insert lines like:
  172.           abbr this
  173.        where abbr is the abbreviation and this is the string to  be
  174.        abbreviated.
  175.  
  176.        The rules governing the formatting are:
  177.        •  abbr must be at the beginning of a line.
  178.        •  this  is delimited on the left by the first space or  tab
  179.           (ie.  the  first blank) which follows abbr,  and  on  the
  180.           right  by a Carriage Return. Therefore, additional spaces
  181.           or  tabs between abbr and this will be considered  to  be
  182.           part   of   this.  Moreover,  there  can  only   be   one
  183.           abbreviation per line.
  184.        •  Only   the   first  199  characters  of  each  line   are
  185.           interpreted.  The  rest of the line is ignored  (ie.  the
  186.           string to be abbreviated is truncated).
  187.        •  Lines  beginning with blanks or containing no  blanks  at
  188.           all are ignored and can be freely used for commenting.
  189.  
  190.        Additionally, be also aware that:
  191.        •  Abbreviations are case sensitive (eg. 'Abc' is  different
  192.           from 'abc' and 'aBc').
  193.        •  Redefinitions are ignored. Therefore, you  will  only  be
  194.           able to use the first definition with a particular abbr.
  195.        •  The   size   of   abbreviation  files   is   limited   to
  196.           approximately  32kByte after removing the  comments  (but
  197.           before    removing   badly   formatted    or    duplicate
  198.           abbreviations).
  199.  
  200.      Telling MacDOS where the Abbreviation File is
  201.        Set  the  global  variable ABBREV to  the  full  path  which
  202.        identifies  the  abbreviation  file  (without  quoting   it,
  203.        because  SET  accepts all characters after the equal  sign).
  204.        If  the  abbreviation file is in a folder  included  in  the
  205.        PATH variable, you only need to set ABBREV to its filename.
  206.  
  207.        When  MacDOS  sees  an assignment to ABBREV,  it  reads  the
  208.        file,  stores the valid abbreviations in a block of  dynamic
  209.        memory, sorts them, and removes the duplicates.
  210.  
  211.      Expanding the Abbreviations
  212.        To  expand  an abbreviation, type the abbr at the  beginning
  213.        of  the command line or following a space. Then press shift-
  214.        tab.  MacDOS then replaces abbr with the corresponding this.
  215.        If  MacDOS does not find any matching abbr, it just  ignores
  216.        your request.
  217.  
  218.        If  you  type  only some initial characters of abbr,  MacDOS
  219.        can  still  perform the replacement as long as  it  finds  a
  220.        single match in the abbreviation file.
  221.  
  222.        If  MacDOS  finds  more than one matching  abbreviation,  it
  223.        lists   them   all   and   re-prompts   you.   MacDOS   also
  224.        automatically   extends   your   partial   abbreviation   if
  225.        possible.
  226.  
  227.      Example
  228.        In  the file "1:\aFold\abbrev file" you stored the following
  229.        lines:
  230.  
  231.        rain     Rainbow Hill
  232.         This line begins with a space. Therefore, it is a comment.
  233.         The following line is empty. Still commenting...
  234.  
  235.        aaaa   Silly abbreviation
  236.        aaBc   Ditto
  237.  
  238.        To activate the abbreviations, type the command:
  239.  
  240.        prompt>set abbrev=1:\aFold\abbrev file
  241.  
  242.        To   see   the   active  abbreviations,  type  a   shift-tab
  243.        immediately after the MacDOS prompt. You will see:
  244.  
  245.          aaBc "Ditto"
  246.          aaaa "Silly abbreviation"
  247.          rain "  Rainbow Hill"
  248.  
  249.        If  you  now  type (either at the beginning of  the  command
  250.        line  or after a space) aaBc followed by a shift-tab, MacDOS
  251.        will  replace it with the string Ditto. The same will happen
  252.        if  you  only type aaB. If you type aa, MacDOS will  display
  253.        the two lines with the abbreviations aaaa and aaBc.
  254.  
  255.        Finally,  if you type a single 'a' before typing  shift-tab,
  256.        MacDOS  will  extend it to 'aa' before typing  the  list  of
  257.        matching abbreviations. That is, MacDOS will recognise  that
  258.        all  the  abbreviations that match 'a' also match  'aa'  and
  259.        will  therefore  append  the  second  'a'  to  your  partial
  260.        abbreviation.
  261.  
  262. Safe Hacks
  263.        This  section explains a couple of simple changes  that  you
  264.        can safely make to MacDOS with ResEdit.
  265.  
  266.    Starting Up
  267.        You  can  remove  the  initial  splash  screen  (sigh!)   by
  268.        deleting or renumbering the 'PICT' resource number  129  (or
  269.        130 for black & white).
  270.  
  271.    Shutting Down
  272.        When  you execute the commands RESTART and SHUTDOWN,  MacDOS
  273.        displays a little picture with a farewell message.  You  can
  274.        replace the corresponding 'PICT' resource number 131 with  a
  275.        picture of your liking.
  276.  
  277.    More Help
  278.        You  can  add help messages by inserting resources  of  type
  279.        'TEXT'.  When you type "help subject", MacDOS  looks  for  a
  280.        'TEXT'  resource named subject. Therefore, you only need  to
  281.        add the necessary text resource and MacDOS will pick it up.
  282.  
  283.        When  you  type  "help ?", MacDOS lists  the  names  of  all
  284.        resources  of  type 'TEXT' beginning with 128  and  stopping
  285.        when  it finds the first missing number. Therefore,  if  you
  286.        want  to have the help items in alphabetical order, you will
  287.        have  to  insert your resource in the appropriate  place  by
  288.        "shifting down" the following ones.
  289.  
  290.        If  you  want to get help on any file, you only need to  add
  291.        to  that  file a resource of type 'TEXT' named  "help".  You
  292.        will  then  be able to type "help file name". It  will  work
  293.        irrespective  of  the  file type. This is  possible  because
  294.        MacDOS,   before  returning  the  error  message  "No   help
  295.        available",  looks  for a file with the requested  name  and
  296.        checks whether it contains a 'TEXT' resource named "help".
  297.  
  298.    Changing Fonts
  299.        When  displaying characters in 9 and 12 points, MacDOS  uses
  300.        a  modified  version  of Monaco with  redefined  zeroes  and
  301.        capital  'i's.  The  bitmapped  fonts  are  stored  in   two
  302.        resources  of  type  'FONT'.  You  can  replace  them   with
  303.        different  fonts,  but  MacDOS  will  only  maintain  proper
  304.        formatting if they are monospaced.
  305.  
  306.